<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>dev: dev/dev/net/Socket.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">dev
   &#160;<span id="projectnumber">0.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_socket_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Socket.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Name         : Socket.hpp</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Author       : 671643387</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Date         : 2015年9月6日</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Description  : 套接字类</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *****************************************************************************/</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef NET_SOCKET_HPP_</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define NET_SOCKET_HPP_</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;dev/net/SocketApi.hpp&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacedev.html">dev</a></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;{</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <span class="keyword">namespace </span>net</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    {</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;        <span class="keyword">class </span>TcpConnection;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;        <span class="keyword">class </span>TcpAcceptor;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html">   23</a></span>&#160;        <span class="keyword">class </span><a class="code" href="classdev_1_1net_1_1_socket.html">Socket</a></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        {</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classdev_1_1net_1_1_tcp_connection.html">TcpConnection</a>;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classdev_1_1net_1_1_tcp_acceptor.html">TcpAcceptor</a>;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;            <a class="code" href="classdev_1_1net_1_1_socket.html">Socket</a>(<span class="keywordtype">int</span> domain, <span class="keywordtype">int</span> type, <span class="keywordtype">int</span> protocol = 0);</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;            <a class="code" href="classdev_1_1net_1_1_socket.html">Socket</a>(sock_t sockfd);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;            ~<a class="code" href="classdev_1_1net_1_1_socket.html">Socket</a>();</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html#aba630380ca8cde22e22a16ddcb4670ae">   39</a></span>&#160;            sock_t <a class="code" href="classdev_1_1net_1_1_socket.html#aba630380ca8cde22e22a16ddcb4670ae">getSocket</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> sock_; }</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html#ab4a310b0db236a8d55f2936373d36f5a">   45</a></span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classdev_1_1net_1_1_socket.html#ab4a310b0db236a8d55f2936373d36f5a">isValid</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> sock_ != INVALID_SOCKET; }</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classdev_1_1net_1_1_socket.html#ad6b109f9f6d599f65edf379866e3fe0b">setNonBlocking</a>(<span class="keywordtype">bool</span> on = <span class="keyword">true</span>);</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classdev_1_1net_1_1_socket.html#a7acfefe85faea54804509eac0e082900">setReuseAddr</a>(<span class="keywordtype">bool</span> on = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;            <span class="keywordtype">bool</span> <a class="code" href="classdev_1_1net_1_1_socket.html#aaddc13c0968b0652436155f8bd5c0daa">setLinger</a>(<span class="keywordtype">bool</span> on = <span class="keyword">false</span>);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_socket.html#adee8179a6f2d53861eeb13b398901845">reset</a>(sock_t sock);</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html#af86b037ac9f6b916c8bc7b174a061297">   81</a></span>&#160;            <span class="keywordtype">void</span>* <a class="code" href="classdev_1_1net_1_1_socket.html#af86b037ac9f6b916c8bc7b174a061297">getUserDataPtr</a>() { <span class="keywordflow">return</span> userData_.ptr; }</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html#a3888df2959501c6d40d021ddc3a47eaf">   87</a></span>&#160;            <span class="keywordtype">int</span> <a class="code" href="classdev_1_1net_1_1_socket.html#a3888df2959501c6d40d021ddc3a47eaf">getUserDataInt</a>() { <span class="keywordflow">return</span> userData_.ival; }</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html#a8526950530c1f58529af1e8f3d225ede">   93</a></span>&#160;            <span class="keywordtype">long</span> <a class="code" href="classdev_1_1net_1_1_socket.html#a8526950530c1f58529af1e8f3d225ede">getUserDataLong</a>() { <span class="keywordflow">return</span> userData_.lval; }</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html#a09404a9a214270685b3f76addf02cd2c">   99</a></span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_socket.html#a09404a9a214270685b3f76addf02cd2c">setUserDataPtr</a>(<span class="keywordtype">void</span>* pV) { userData_.ptr = pV; }</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html#a1d666eda7b16aceca6feebc6151b2355">  105</a></span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_socket.html#a1d666eda7b16aceca6feebc6151b2355">setUserDataInt</a>(<span class="keywordtype">int</span> x) { userData_.ival = x; }</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_socket.html#a5bcb192e9d5da628370c89e357a0103f">  111</a></span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_socket.html#a5bcb192e9d5da628370c89e357a0103f">setUserDataLong</a>(<span class="keywordtype">long</span> x) { userData_.lval = x; }</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            <span class="keywordtype">int</span> <a class="code" href="classdev_1_1net_1_1_socket.html#a25675e062ae83762dd1e25ef745f6ba1">receive</a>(<span class="keywordtype">char</span>* buff, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> flags = 0);</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;            <span class="keywordtype">int</span> <a class="code" href="classdev_1_1net_1_1_socket.html#af2218f65624a640161009ddd0bfa509e">send</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* buff, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> flags = 0);</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_socket.html#abf71d50699036a8a69cb362a9ac7ad02">close</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            </div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            sock_t sock_;   <span class="comment">// 本地套接字</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;            <span class="keyword">union</span></div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            {</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                <span class="keywordtype">void</span>* ptr;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                <span class="keywordtype">int</span> ival;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                <span class="keywordtype">long</span> lval;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            } userData_;    <span class="comment">// 用户数据</span></div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        };</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    }</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;}</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* NET_SOCKET_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_af2218f65624a640161009ddd0bfa509e"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#af2218f65624a640161009ddd0bfa509e">dev::net::Socket::send</a></div><div class="ttdeci">int send(const char *buff, size_t length, int flags=0)</div><div class="ttdoc">发送数据 </div><div class="ttdef"><b>Definition:</b> Socket.cpp:84</div></div>
<div class="ttc" id="namespacedev_html"><div class="ttname"><a href="namespacedev.html">dev</a></div><div class="ttdef"><b>Definition:</b> Atomic.hpp:18</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_aaddc13c0968b0652436155f8bd5c0daa"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#aaddc13c0968b0652436155f8bd5c0daa">dev::net::Socket::setLinger</a></div><div class="ttdeci">bool setLinger(bool on=false)</div><div class="ttdoc">设置套接字linger状态 </div><div class="ttdef"><b>Definition:</b> Socket.cpp:50</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_ab4a310b0db236a8d55f2936373d36f5a"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#ab4a310b0db236a8d55f2936373d36f5a">dev::net::Socket::isValid</a></div><div class="ttdeci">bool isValid(void) const </div><div class="ttdoc">判断套接字是否有效 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:45</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_a5bcb192e9d5da628370c89e357a0103f"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#a5bcb192e9d5da628370c89e357a0103f">dev::net::Socket::setUserDataLong</a></div><div class="ttdeci">void setUserDataLong(long x)</div><div class="ttdoc">设置用户数据 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:111</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_a8526950530c1f58529af1e8f3d225ede"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#a8526950530c1f58529af1e8f3d225ede">dev::net::Socket::getUserDataLong</a></div><div class="ttdeci">long getUserDataLong()</div><div class="ttdoc">获取用户数据 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:93</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_ad6b109f9f6d599f65edf379866e3fe0b"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#ad6b109f9f6d599f65edf379866e3fe0b">dev::net::Socket::setNonBlocking</a></div><div class="ttdeci">bool setNonBlocking(bool on=true)</div><div class="ttdoc">设置套接字阻塞状态 </div><div class="ttdef"><b>Definition:</b> Socket.cpp:39</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_a1d666eda7b16aceca6feebc6151b2355"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#a1d666eda7b16aceca6feebc6151b2355">dev::net::Socket::setUserDataInt</a></div><div class="ttdeci">void setUserDataInt(int x)</div><div class="ttdoc">设置用户数据 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:105</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_abf71d50699036a8a69cb362a9ac7ad02"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#abf71d50699036a8a69cb362a9ac7ad02">dev::net::Socket::close</a></div><div class="ttdeci">void close(void)</div><div class="ttdoc">关闭套接字 </div><div class="ttdef"><b>Definition:</b> Socket.cpp:30</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_acceptor_html"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_acceptor.html">dev::net::TcpAcceptor</a></div><div class="ttdef"><b>Definition:</b> TcpAcceptor.hpp:27</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_adee8179a6f2d53861eeb13b398901845"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#adee8179a6f2d53861eeb13b398901845">dev::net::Socket::reset</a></div><div class="ttdeci">void reset(sock_t sock)</div><div class="ttdoc">重置内部原始本地套接字 </div><div class="ttdef"><b>Definition:</b> Socket.cpp:106</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_aba630380ca8cde22e22a16ddcb4670ae"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#aba630380ca8cde22e22a16ddcb4670ae">dev::net::Socket::getSocket</a></div><div class="ttdeci">sock_t getSocket() const </div><div class="ttdoc">获取本地套接字 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:39</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_a3888df2959501c6d40d021ddc3a47eaf"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#a3888df2959501c6d40d021ddc3a47eaf">dev::net::Socket::getUserDataInt</a></div><div class="ttdeci">int getUserDataInt()</div><div class="ttdoc">获取用户数据 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:87</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_a09404a9a214270685b3f76addf02cd2c"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#a09404a9a214270685b3f76addf02cd2c">dev::net::Socket::setUserDataPtr</a></div><div class="ttdeci">void setUserDataPtr(void *pV)</div><div class="ttdoc">设置用户数据 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:99</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_a7acfefe85faea54804509eac0e082900"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#a7acfefe85faea54804509eac0e082900">dev::net::Socket::setReuseAddr</a></div><div class="ttdeci">bool setReuseAddr(bool on=false)</div><div class="ttdoc">设置套接字阻塞是否重用地址 </div><div class="ttdef"><b>Definition:</b> Socket.cpp:44</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html">dev::net::TcpConnection</a></div><div class="ttdoc">Tcp连接 </div><div class="ttdef"><b>Definition:</b> TcpConnection.hpp:31</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_af86b037ac9f6b916c8bc7b174a061297"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#af86b037ac9f6b916c8bc7b174a061297">dev::net::Socket::getUserDataPtr</a></div><div class="ttdeci">void * getUserDataPtr()</div><div class="ttdoc">获取用户数据 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:81</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html_a25675e062ae83762dd1e25ef745f6ba1"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html#a25675e062ae83762dd1e25ef745f6ba1">dev::net::Socket::receive</a></div><div class="ttdeci">int receive(char *buff, size_t length, int flags=0)</div><div class="ttdoc">接收数据 </div><div class="ttdef"><b>Definition:</b> Socket.cpp:58</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html">dev::net::Socket</a></div><div class="ttdoc">套接字 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:23</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_5fc0168d11760b9445bd29fa15d9290f.html">dev</a></li><li class="navelem"><a class="el" href="dir_1ca75188a6074d2843e8fd5d982c3101.html">dev</a></li><li class="navelem"><a class="el" href="dir_cea828ca1984caf90af75ecf8a99968a.html">net</a></li><li class="navelem"><b>Socket.hpp</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
